home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple WWDC 1996
/
WWDC96_1996 (CD).toast
/
Technology Materials
/
MacOS 8 Resources
/
Developer Tools
/
Mac OS 8 Interfaces & Libraries
/
Interfaces
/
CIncludes
/
Processes.h
< prev
next >
Wrap
C/C++ Source or Header
|
1996-05-01
|
7KB
|
255 lines
/*
File: Processes.h
Contains: Process Manager Interfaces.
Version: Technology: System 7.5
Release: Universal Interfaces 3.0d3 on Copland DR1
Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
Bugs?: If you find a problem with this file, send the file and version
information (from above) and the problem description to:
Internet: apple.bugs@applelink.apple.com
AppleLink: APPLE.BUGS
*/
#ifndef __PROCESSES__
#define __PROCESSES__
#ifndef __TYPES__
#include <Types.h>
#endif
#ifndef __EVENTS__
#include <Events.h>
#endif
#ifndef __FILES__
#include <Files.h>
#endif
#if FOR_SYSTEM8_PREEMPTIVE
#ifndef __KERNEL__
#include <Kernel.h>
#endif
#ifndef __FILEMANAGERTYPES__
#include <FileManagerTypes.h>
#endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if PRAGMA_IMPORT_SUPPORTED
#pragma import on
#endif
#if PRAGMA_ALIGN_SUPPORTED
#pragma options align=mac68k
#endif
/* type for unique process identifier */
struct ProcessSerialNumber {
unsigned long highLongOfPSN;
unsigned long lowLongOfPSN;
};
typedef struct ProcessSerialNumber ProcessSerialNumber;
typedef ProcessSerialNumber *ProcessSerialNumberPtr;
enum {
/* Process identifier - Various reserved process serial numbers */
kNoProcess = 0,
kSystemProcess = 1,
kCurrentProcess = 2
};
#if FOR_SYSTEM8_PREEMPTIVE
enum {
/* supported versions for GetApplicationInformation*/
kApplicationInformationVersion = 1
};
struct ApplicationInformation {
TaskID primaryTaskID;
KernelProcessID applicationLauncher;
FSObjectRef applicationFile;
};
typedef struct ApplicationInformation ApplicationInformation;
typedef ApplicationInformation *ApplicationInformationPtr;
extern OSStatus GetApplicationInformation(KernelProcessID theProcessID, PBVersion version, ApplicationInformation *appInfo);
enum {
/* supported versions for LaunchInformation structure*/
kLaunchInformationVersion = 1
};
struct LaunchInformation {
KernelProcessID kernelProcessID;
};
typedef struct LaunchInformation LaunchInformation;
typedef LaunchInformation *LaunchInformationPtr;
/* for now, the launch call only supports an application in the FSObjectSpecification*/
extern OSStatus Launch(FSObjectRef theFSObjectRef, PBVersion version, LaunchInformation *launchInfo);
extern OSStatus GetKernelProcessIDFromPSN(const ProcessSerialNumber *PSN, KernelProcessID *kernelProcessID);
extern OSStatus GetPSNFromKernelProcessID(KernelProcessID kernelProcessID, ProcessSerialNumber *PSN);
#endif
/* Definition of the parameter block passed to _Launch */
/*
Typedef and flags for launchControlFlags field
#if FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED??
*/
typedef unsigned short LaunchFlags;
enum {
launchContinue = 0x4000,
launchNoFileFlags = 0x0800,
launchUseMinimum = 0x0400,
launchDontSwitch = 0x0200,
launchAllow24Bit = 0x0100,
launchInhibitDaemon = 0x0080
};
/*
Format for first AppleEvent to pass to new process. The size of the overall
buffer variable: the message body immediately follows the messageLength
*/
struct AppParameters {
EventRecord theMsgEvent;
unsigned long eventRefCon;
unsigned long messageLength;
};
typedef struct AppParameters AppParameters;
typedef AppParameters *AppParametersPtr;
/* Parameter block to _Launch */
struct LaunchParamBlockRec {
unsigned long reserved1;
unsigned short reserved2;
unsigned short launchBlockID;
unsigned long launchEPBLength;
unsigned short launchFileFlags;
LaunchFlags launchControlFlags;
FSSpecPtr launchAppSpec;
ProcessSerialNumber launchProcessSN;
unsigned long launchPreferredSize;
unsigned long launchMinimumSize;
unsigned long launchAvailableSize;
AppParametersPtr launchAppParameters;
};
typedef struct LaunchParamBlockRec LaunchParamBlockRec;
typedef LaunchParamBlockRec *LaunchPBPtr;
/*
Set launchBlockID to extendedBlock to specify that extensions exist.
Set launchEPBLength to extendedBlockLen for compatibility.
*/
enum {
extendedBlock = 0x4C43, /* 'LC' */
extendedBlockLen = sizeof(LaunchParamBlockRec) - 12
};
enum {
/* Definition of the information block returned by GetProcessInformation */
modeLaunchDontSwitch = 0x00040000,
modeDeskAccessory = 0x00020000,
modeMultiLaunch = 0x00010000,
modeNeedSuspendResume = 0x00004000,
modeCanBackground = 0x00001000,
modeDoesActivateOnFGSwitch = 0x00000800,
modeOnlyBackground = 0x00000400,
modeGetFrontClicks = 0x00000200,
modeGetAppDiedMsg = 0x00000100,
mode32BitCompatible = 0x00000080,
modeHighLevelEventAware = 0x00000040,
modeLocalAndRemoteHLEvents = 0x00000020,
modeStationeryAware = 0x00000010,
modeUseTextEditServices = 0x00000008,
modeDisplayManagerAware = 0x00000004
};
/* Record returned by GetProcessInformation */
struct ProcessInfoRec {
unsigned long processInfoLength;
StringPtr processName;
ProcessSerialNumber processNumber;
unsigned long processType;
OSType processSignature;
unsigned long processMode;
Ptr processLocation;
unsigned long processSize;
unsigned long processFreeMem;
ProcessSerialNumber processLauncher;
unsigned long processLaunchDate;
unsigned long processActiveTime;
FSSpecPtr processAppSpec;
};
typedef struct ProcessInfoRec ProcessInfoRec;
typedef ProcessInfoRec *ProcessInfoRecPtr;
/* #endif // FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED??*/
#if FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED
#if GENERATING68K && !GENERATINGCFM
#pragma parameter __D0 LaunchApplication(__A0)
#endif
extern pascal OSErr LaunchApplication(LaunchPBPtr LaunchParams)
ONEWORDINLINE(0xA9F2);
extern pascal OSErr LaunchDeskAccessory(const FSSpec *pFileSpec, ConstStr255Param pDAName)
THREEWORDINLINE(0x3F3C, 0x0036, 0xA88F);
extern pascal OSErr GetCurrentProcess(ProcessSerialNumber *PSN)
THREEWORDINLINE(0x3F3C, 0x0037, 0xA88F);
extern pascal OSErr GetFrontProcess(ProcessSerialNumber *PSN)
FIVEWORDINLINE(0x70FF, 0x2F00, 0x3F3C, 0x0039, 0xA88F);
extern pascal OSErr GetNextProcess(ProcessSerialNumber *PSN)
THREEWORDINLINE(0x3F3C, 0x0038, 0xA88F);
extern pascal OSErr GetProcessInformation(const ProcessSerialNumber *PSN, ProcessInfoRec *info)
THREEWORDINLINE(0x3F3C, 0x003A, 0xA88F);
extern pascal OSErr SetFrontProcess(const ProcessSerialNumber *PSN)
THREEWORDINLINE(0x3F3C, 0x003B, 0xA88F);
extern pascal OSErr WakeUpProcess(const ProcessSerialNumber *PSN)
THREEWORDINLINE(0x3F3C, 0x003C, 0xA88F);
extern pascal OSErr SameProcess(const ProcessSerialNumber *PSN1, const ProcessSerialNumber *PSN2, Boolean *result)
THREEWORDINLINE(0x3F3C, 0x003D, 0xA88F);
#endif
#if FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE
#if !OLDROUTINELOCATIONS
extern pascal void ExitToShell(void )
ONEWORDINLINE(0xA9F4);
#endif
#endif
#if PRAGMA_ALIGN_SUPPORTED
#pragma options align=reset
#endif
#if PRAGMA_IMPORT_SUPPORTED
#pragma import off
#endif
#ifdef __cplusplus
}
#endif
#endif /* __PROCESSES__ */